<template>
	<view class="pb">
		<view class="recurit p0-8" @click="onLink('/pages/recruit/info/index',item.id)" v-for="(item ,index) in dataInfo" :key="index">
			<uni-section :title="item.title" titleFontSize="30rpx" :sub-title="item.city+' | '+item.experience+' | '+item.education" padding="0 0 5px 10px">
				<template v-slot:right><view class="red"><b>{{item.salary}}/{{item.salary_type}}</b></view></template>
			</uni-section>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form:{
					city: "",
					education: 0,
					experience: 0,
					page: 1,
					type: 0,
					wages: 0,
				},
				dataInfo:[]
			}
		},
		onLoad(options){
			this.form.id = options.id
			this.onGetInfo()
		},
		methods: {
			onGetInfo(){
				let _this = this
				this.$request_api('applet_api/company/job/list','POST',this.form).then(res => {
					_this.dataInfo = res.data
					_this.dataInfo.forEach((e) => {
						e.education = _this.$func.edu[e.education]
						e.experience = _this.$func.exp[e.experience]
						e.scale = _this.$func.scale[e.scale]
						e.salary = e.salary_type == 2 ? _this.$func.month_wages[e.salary] : _this.$func.year_wages[e.salary]
						e.salary_type = e.salary_type == 2 ? '月' : '年'
					})
				}).catch(err => {
					console.log(err)
				})
			},
			onLink(url,id){
				this.$func.onLink(url,id)
			},
		}
	}
</script>

<style>
.recurit{border-bottom: 1px solid #EEE;}
</style>
